#pragma once

#include <iostream>
#include <string>
#include <ctime>

#define NORMAL 1
#define WARNING 2
#define FATAL 3
#define DEBUG 4

// 使用#宏参数，将宏参数转换为原本的字符串 eg. 传入的为NORMAL，本来的定义为1，#LEVEL将其解释为原本传入的字符串，即传入了NORMAL
#define LOG(LEVEL, MESSAGE) log(#LEVEL, MESSAGE, __FILE__, __LINE__)

void log(std::string level, std::string message, std::string file, int line)
{
    std::cout << "[" << level << "][" << time(nullptr) << "][" << message << "][" << file << " : " << line << "]" << std::endl;
}